﻿package sedie 
{
	import flash.display.MovieClip;
	import game.constants.ConstData;
	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)	
	 */
	public class WinLosePanel extends MovieClip
	{
		public var Sd00, Sd01, Sd03, Sd04, SdEven, SdOdd:MovieClip;
		
		public var highLightArr:Array;
		
		public function WinLosePanel() 
		{
			highLightArr = new Array();
			highLightArr = [Sd00, Sd01, Sd03, Sd04, SdEven, SdOdd];
			init();
		}
		
		public function showWinLose(result:String):void 
		{
			init();
			var temp:String = result.substr(ConstData.POS_SEDIE_RESULT, ConstData.LEN_SEDIE_RESULT);
			switch(temp) {
				
				case "0":
					show(Sd00);
					show(SdEven);
					break;
				case "1":
					show(Sd01);
					show(SdOdd);
					break;
				case "2":
					show(SdEven);
					break;
				case "3":
					show(Sd03);
					show(SdOdd);
					break;
				case "4":
					show(Sd04);
					show(SdEven);
					break;
				
			}	
			
		}
		
		/**
		 * @author	Bamboo
		 * @param	mcWin
		 */
		private function show(mcWin:MovieClip):void {
			mcWin.visible = true;
			mcWin.gotoAndPlay(2);
		}
		/**
		 * @author	Bamboo
		 */
		public function init():void {
			var temp:MovieClip = new MovieClip();
			for (var i:int = 0; i < highLightArr.length; i++)
			{
				temp = highLightArr[i];
				temp.visible = false;
				temp.gotoAndStop(1);
				
			}
		}
	}

}